import axios from '@/http/axios'
export default{
    namespaced:true,
    state:{
        custermerData:[]
    },
    getters:{},
    mutations:{
        setCustermerData(state,data){
            state.custermerData=data
        }
    },
    actions:{
        async toDeleteCustermers(context,params){
            let res = await axios.get('/customer/deleteById?id='+params)
        },
        async toSaveCustermers(context,params){
            return await axios.post('/customer/saveOrUpdate',params)
        },
        async toLoadCustermers(context,params){
            let res = await axios.post('/customer/query',params)
            context.commit('setCustermerData',res.data.data)
        }
    }
}